package alex.deploy.repository;

import alex.deploy.model.Project;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * Created by lushun.chen on 2017/4/26.
 *
 * @author lushun.chen
 */
@Repository
public interface ProjectRepository extends JpaRepository<Project, Long> {

    @Query("select t from Project t where t.name like :name")
    Page<Project> findByName(@Param("name")String name, Pageable pageable);
}
